package poiUntil;

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.util.HashMap;
import java.util.Map;

public class DoOffice_word_poi {

	public static void main(String[] args) throws Exception {

		Map<String, Object> data = new HashMap<String, Object>();
		//page1
		data.put("${describeNo}","深儒骏辉评字 [2017]0101018号");
		data.put("${propertyName}","深圳市龙岗区横岗信义锦绣花园1号楼一单元1004住宅房地产抵押价值评估");
		data.put("${obligee}","施哲雄");
		data.put("${appraiserName1}","汤路生");
		data.put("${appraiserPhone1}","4319960116");
		data.put("${appraiserName2}","卢志华");
		data.put("${appraiserPhone2}","4319980083");
		data.put("${reportTimeEnd}","二〇一七年一月十一日");

		//page2
		data.put("${page2obligee}","施哲雄");
		data.put("${page2propertyAdress}","深圳市龙岗区横岗信义锦绣花园1号楼一单元1004住宅");
		data.put("${page2reportTimeBegin}","2016年12月06日");
		data.put("${page2objective}","确定房地产抵押贷款额度提供参考依据而评估房地产抵押价值");
		data.put("${page2sumPrice}","5,012,986");
		data.put("${page2sumPriceTex}","伍佰零壹万贰仟玖佰捌拾陆");
		data.put("${page2taxationSum}","854,709");
		data.put("${page2netWorth}","4,158,277");
		data.put("${page2netWorthTex}","肆佰壹拾伍万捌仟贰佰柒拾柒");
		data.put("${page2propertyName}","信义锦绣花园1号楼一单元1004");
		data.put("${page2housingType}","住宅");
		data.put("${page2area}","64.64");
		data.put("${page2registerPrice}","1,560,465.00");
		data.put("${page2enquiryPrice}","38,200");
		data.put("${page2housePrice}","2,469,248");
		data.put("${page2houseTax}","421,952");
		data.put("${page2housenetWorth}","2,047,296");
		data.put("${page2reportTimeBeginTex}","二〇一七年一月十一日");


		//page3
		data.put("${page3appraiserName1}","汤路生");
		data.put("${page3appraiserPhone1}","4319960116");
		data.put("${page3appraiserName2}","卢志华");
		data.put("${page3appraiserPhone2}","4319980083");


		//page4

		data.put("${page4reportTimeEnd}","2017年1月11日");


		//page5
		data.put("${page5obligee}","施哲雄");
		data.put("${page5propertyName}","信义锦绣花园1号楼一单元1004");
		data.put("${page5propertyAdress}","深圳市龙岗区横岗信义锦绣花园1号楼一单元1004住宅");
		data.put("${page5area}","64.64");
		data.put("${page5beLocated}","深圳市龙岗区横岗");
		data.put("${page5houseCardNo}","6000283616");
		data.put("${page5housingType}","住宅");



		data.put("${page5landType}","商住混合用地");
		data.put("${page5landArea}","71947.85");
		data.put("${page5landUseTime}","70");
		data.put("${page5landUseTimeBegin}","2001年01月08日");
		data.put("${page5landUseTimeEnd}","2071年01月07日");

		data.put("${page5locationEast}","横岗一号路");
		data.put("${page5locationSouth}","乐清路");
		data.put("${page5locationWestern}","康乐路");
		data.put("${page5locationNorth}","红棉路");


		data.put("${page5shape}","矩形");
		data.put("${page5developmentLevel}","六通一平");
		data.put("${page5buildStructure}","框架结构");
		data.put("${page5locationNorth}","二房一厅一卫");
		data.put("${page5degree}","九成新");
		data.put("${page5orientation}","西南");

		data.put("${page5floorSum}","18");
		data.put("${page5floor}","10");

		data.put("${page5facility}","网络接线、有线电视、管道燃气、电梯");
		data.put("${page5fitment}","外墙：涂料；内墙：乳胶漆；天花：乳胶漆；地面：抛光地砖；厨房：地面防滑地砖、墙面瓷片到顶、天花铝扣板吊顶、整体橱柜；卫生间：地面防滑地砖、墙面瓷片到顶、天花铝扣板吊顶、二洁具。");

		data.put("${page5surveyTimeTex}","二〇一六年十二月六日");

		//page6
		data.put("${page6reportTimeEnd}","2017年1月11日");
		data.put("${page6sumPrice}","5,012,986");
		data.put("${page6sumPriceTex}","伍佰零壹万贰仟玖佰捌拾陆");
		data.put("${page6taxationSum}","854,709");
		data.put("${page6netWorth}","4,158,277");
		data.put("${page6netWorthTex}","肆佰壹拾伍万捌仟贰佰柒拾柒");
		data.put("${page6appraiserName1}","汤路生");
		data.put("${page6appraiserPhone1}","4319960116");
		data.put("${page6appraiserName2}","卢志华");
		data.put("${page6appraiserPhone2}","4319980083");
		data.put("${page6appraiserAssistant}","彭力宇");

		data.put("${page6reportBeginTime}","二〇一六年十二月六日");
		data.put("${page6reportEndTime}","二〇一七年一月十一日");



		/**
		 * 图片
		 */
		//附件一
		Map<String,Object> photo = new HashMap<String, Object>();
		photo.put("width", 868);
		photo.put("height", 578);
		photo.put("type", "jpg");
		photo.put("content", poi_Word.inputStream2ByteArray(new FileInputStream("E:\\nxhz-nbtc-work\\wordpoi\\src\\main\\resources\\template\\poi\\c1.jpg"), true));
		data.put("${photo}",photo);
		//附件二
		Map<String,Object> photo2 = new HashMap<String, Object>();
		photo2.put("width", 280);
		photo2.put("height", 280);
		photo2.put("type", "jpg");
		photo2.put("content", poi_Word.inputStream2ByteArray(new FileInputStream("E:\\nxhz-nbtc-work\\wordpoi\\src\\main\\resources\\template\\poi\\c2.png"), true));
		data.put("${photo2}",photo2);

		Map<String,Object> photo3 = new HashMap<String, Object>();
		photo3.put("width", 280);
		photo3.put("height", 280);
		photo3.put("type", "jpg");
		photo3.put("content", poi_Word.inputStream2ByteArray(new FileInputStream("E:\\nxhz-nbtc-work\\wordpoi\\src\\main\\resources\\template\\poi\\c2.png"), true));
		data.put("${photo3}",photo3);

		Map<String,Object> photo4 = new HashMap<String, Object>();
		photo4.put("width", 280);
		photo4.put("height", 280);
		photo4.put("type", "jpg");
		photo4.put("content", poi_Word.inputStream2ByteArray(new FileInputStream("E:\\nxhz-nbtc-work\\wordpoi\\src\\main\\resources\\template\\poi\\c2.png"), true));
		data.put("${photo4}",photo4);

		Map<String,Object> photo5 = new HashMap<String, Object>();
		photo5.put("width", 280);
		photo5.put("height", 280);
		photo5.put("type", "jpg");
		photo5.put("content", poi_Word.inputStream2ByteArray(new FileInputStream("E:\\nxhz-nbtc-work\\wordpoi\\src\\main\\resources\\template\\poi\\c2.png"), true));
		data.put("${photo5}",photo5);


		Map<String,Object> photo6 = new HashMap<String, Object>();
		photo6.put("width", 280);
		photo6.put("height", 280);
		photo6.put("type", "jpg");
		photo6.put("content", poi_Word.inputStream2ByteArray(new FileInputStream("E:\\nxhz-nbtc-work\\wordpoi\\src\\main\\resources\\template\\poi\\c2.png"), true));
		data.put("${photo6}",photo6);


		Map<String,Object> photo7 = new HashMap<String, Object>();
		photo7.put("width", 280);
		photo7.put("height", 280);
		photo7.put("type", "jpg");
		photo7.put("content", poi_Word.inputStream2ByteArray(new FileInputStream("E:\\nxhz-nbtc-work\\wordpoi\\src\\main\\resources\\template\\poi\\c2.png"), true));
		data.put("${photo7}",photo7);

		//附件3

		Map<String,Object> photo8 = new HashMap<String, Object>();
		photo8.put("width", 900);
		photo8.put("height", 635);
		photo8.put("type", "jpg");
		photo8.put("content", poi_Word.inputStream2ByteArray(new FileInputStream("E:\\nxhz-nbtc-work\\wordpoi\\src\\main\\resources\\template\\poi\\c2.png"), true));
		data.put("${photo8}",photo8);


		Map<String,Object> photo9 = new HashMap<String, Object>();
		photo9.put("width", 900);
		photo9.put("height", 635);
		photo9.put("type", "jpg");
		photo9.put("content", poi_Word.inputStream2ByteArray(new FileInputStream("E:\\nxhz-nbtc-work\\wordpoi\\src\\main\\resources\\template\\poi\\c2.png"), true));
		data.put("${photo9}",photo9);


		//附件5
		Map<String,Object> photo10 = new HashMap<String, Object>();
		photo10.put("width", 600);
		photo10.put("height", 400);
		photo10.put("type", "jpg");
		photo10.put("content", poi_Word.inputStream2ByteArray(new FileInputStream("E:\\nxhz-nbtc-work\\wordpoi\\src\\main\\resources\\template\\poi\\c2.png"), true));
		data.put("${photo10}",photo10);

		Map<String,Object> photo11 = new HashMap<String, Object>();
		photo11.put("width", 600);
		photo11.put("height", 400);
		photo11.put("type", "jpg");
		photo11.put("content", poi_Word.inputStream2ByteArray(new FileInputStream("E:\\nxhz-nbtc-work\\wordpoi\\src\\main\\resources\\template\\poi\\c2.png"), true));
		data.put("${photo11}",photo11);


		//附件6
		Map<String,Object> photo12 = new HashMap<String, Object>();
		photo12.put("width", 600);
		photo12.put("height", 400);
		photo12.put("type", "jpg");
		photo12.put("content", poi_Word.inputStream2ByteArray(new FileInputStream("E:\\nxhz-nbtc-work\\wordpoi\\src\\main\\resources\\template\\poi\\c2.png"), true));
		data.put("${photo12}",photo12);

		Map<String,Object> photo13 = new HashMap<String, Object>();
		photo13.put("width", 600);
		photo13.put("height", 400);
		photo13.put("type", "jpg");
		photo13.put("content", poi_Word.inputStream2ByteArray(new FileInputStream("E:\\nxhz-nbtc-work\\wordpoi\\src\\main\\resources\\template\\poi\\c2.png"), true));
		data.put("${photo13}",photo13);


		CustomXWPFDocument doc = poi_Word.generateWord(data, "E:\\nxhz-nbtc-work\\wordpoi\\src\\main\\resources\\template\\poi\\poi_test.docx");
		FileOutputStream fopts = new FileOutputStream("E:\\nxhz-nbtc-work\\wordpoi\\src\\main\\resources\\file\\poi_model.docx");
		doc.write(fopts);
		fopts.close();
	}
}